// 注册

import React, { Component } from 'react'
import {
  InputItem
} from 'antd-mobile'

export default class Register extends Component {
  constructor(props) {
    super(props)
    this.state = {
      phone:"",
      code:"",
      password:""
    }
  }
  onChangephone = (val)=>{
    this.setState({
      phone:val
    })
  }
  onChangecode = (val)=>{
    this.setState({
      code:val
    })
  }
  onChangepassword = (val)=>{
    this.setState({
      password:val
    })
  }
  toLogin = ()=>{
    this.props.history.push("/login")
  }
  render() {
    return (
      <div className="login-wrap">
        <div>
          <InputItem
            type="text"
            placeholder="输入手机号码"
            clear
            maxLength={11}
            onChange={this.onChangephone}
            value={this.state.phone}
            className="login-input"
          ></InputItem>
          <div className="posrelative">
            <InputItem
              type="text"
              placeholder="输入验证码"
              maxLength={11}
              onChange={this.onChangecode}
              value={this.state.code}
              className="login-input"
            ></InputItem>
            <span className="sendcode">获取验证码</span>
          </div>
          <InputItem
            type="text"
            placeholder="输入密码"
            clear
            maxLength={11}
            onChange={this.onChangepassword}
            value={this.state.password}
            className="login-input border-bottom"
          ></InputItem>
        </div>
        <div className="login-btn red-btn">确定</div>
        <p className="account-text" onClick={this.toLogin}>登录</p>
      </div>
    )
  }
}
